-
-
Notifications
You must be signed in to change notification settings - Fork 135
very simple and hacky path item parameter override test #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #145 +/- ##
==========================================
- Coverage 96.75% 96.19% -0.56%
==========================================
Files 58 58
Lines 1601 1602 +1
==========================================
- Hits 1549 1541 -8
- Misses 52 61 +9
Continue to review full report at Codecov.
|
@gweis thanks for the PR.
It's absolutely okay to have many parameters with the same name and different location. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#fixed-fields-7
|
@p1c2u thanks for pointing that out. (It's sometimes a bit hard to keep following all the little details) There is only one part left then, the part about validating overridden parameters. (I have updated the test cases, it's less tacky now :) If you have any pointers on where in the code base to fix that, I can have a look and create a PR. I assume somewhere in this class? https://github.com/p1c2u/openapi-core/blob/master/openapi_core/validation/request/validators.py#L12 |
I think I was able to put a fix together as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. LGTM 👍
Hi. This is a follow up on #140 and #144.
The fix in #144 is good enough for me and solves my use case. (Thanks again @p1c2u)
However I thought I play around a bit and test overriding parameters. Here are two very simple (and hacky) test cases to demonstrate that.
The issue of overriding
Path Item Parameters
withOperation Parameters
is a bit more complex though. First it is possible to create an invalidSpec
object by overriding a parameter with same name but differentin
attribute. The second part is parameter validation, which should only validate with the overridden parameter definition from theOperation
object.I believe it is a rather rare use case to override parameters, but I thought I'll put it up here. It does not hinder me using this fantastic library and I know that this pull-request is not really mergeable (I only put it together in one place to better demonstrate the two sides of this issue).